package com.desire.test;

/**
 * @author desire
 */
public class _07_递归 {
    static int index = 3;
    static int a = 0, b = 1;

    public static void main(String[] args) {
        for (int i = 0; i <= 6; i++) {
            System.out.print(fib(i) + " ");
        }
        System.out.println();
        m(5);
    }

    public static long fib(long number) {
        if ((number == 0) || (number == 1)) {
            return number;
        } else {
            return fib(number - 1) + fib(number - 2);
        }
    }

    public static void m(int i) {
        System.out.print(index - i-- + 1 + " ");
        if (i < 1) {
            return;
        } else {
            m(i);
        }
    }
}
